package com.javaspeak.designpatterns.go4.behavioural.state;


public abstract class AbstractAccountState implements State {

    int salary;
    float balance;


    public AbstractAccountState( int salary, float balance ){

        this.salary = salary;
        this.balance = balance;
    }


    /* (non-Javadoc)
     * @see com.javaspeak.designpatterns.go4.behavioural.state.State#getBalance()
     */
    @Override
    public float getBalance() {

        return balance;
    }


    /* (non-Javadoc)
     * @see com.javaspeak.designpatterns.go4.behavioural.state.State#getSalary()
     */
    @Override
    public int getSalary() {

        return salary;
    }


    public String toString(){

        StringBuffer sb = new StringBuffer();
        sb.append( "Account Name : " );
        sb.append( getAccountName() );
        sb.append( ", Overdraft : " );
        sb.append( getOverdraft() );
        sb.append( ", balance : " );
        sb.append( balance );
        sb.append( ", salary : " );
        sb.append( salary );

        return sb.toString();
    }
}
